import { createRouter, createWebHistory } from "vue-router";
import routes from "./routes";
const router = createRouter({
    history: createWebHistory(),
    routes,
})


router.beforeEach((to, from) => {

    if (to.path == '/home' || to.path == '/advertising' || to.path == '/perm' || to.path == '/content/idea' || to.path == '/about') {

        if (localStorage.getItem('token')) {
            return true
        } else {
            return '/Login'
        }

    } else {
        return true
    }

})


export default router